L=1000000000; S=1; T=4; M=100; stones=[208917736,208917733,342702175,53219456,208917741,208917737,208917738,143016145,183226951,225809641,632389141,99660988,208917735,208917739,145074829,208917734,71302141,208917740,888671824,110565001,99468748,99468751,99468756,99468750,99468754,282449329,71259362,187499521,227739556,99468752,3694969,170951023,389082541,34492533,211139759,223504088,99468755,71924403,94599025,7894840,90047641,90047642,90047646,5562143,437697781,90047644,3776207,8629881,90047649,451844437,491577398,90047643,861867938,228425563,435345679,45460186,90047645,90047647,384986573,549380836,340920113,340920119,340920117,340920112,283045625,340920115,340920118,95526133,355238494,356030951,150187411,391371085,340920114,12504922,4535551,40127849,119061502,77660686,47209046,226699696,121891180,121891183,121891179,121891182,121891184,121891177,251337442,282931426,361836991,48778815,271396933,3797761,204700651,1114673,452541451,112420571,67994753,121891181,11278894,141150181];